const express = require("express");
const app = express();
const client = require("./routers/client");
const back = require('./routers/back');
const test_router = require("./routers/testTool");

app.all('*', (req, res, next)=>{
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With,Content-Type,AccessToken");
    res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    next();
});

app.use(client);
app.use(back);
app.use(test_router);

app.listen(80, ()=>{
    console.log("This Server Is Running. At http://127.0.0.1:80.");
})